<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<!-- 	5,计算器 -->
		<input type="text" id="inp1"/>
		<select name="chose" id="jis">
			<option value="a">+</option>
			<option value="b">-</option>
			<option value="c">*</option>
			<option value="d">/</option>
		</select>
		<input type="text" id="inp2"/>
		<button type="button" onclick="js();">=</button>
		<input type="text" id="inp3" />
	</body>
	<script type="text/javascript">
		function js(){
			var chose=document.getElementById("jis").value
			var num1=parseFloat(document.getElementById("inp1").value)
			var num2=parseFloat(document.getElementById("inp2").value)
			if(chose=="a"){
							document.getElementById("inp3").value= (num1+num2).toFixed(4);
						}else if (chose=="b"){
							document.getElementById("inp3").value= (num1-num2).toFixed(4);
						}else if (chose=="c"){
							document.getElementById("inp3").value= (num1*num2).toFixed(4);
						}else if (chose=="d"){
							document.getElementById("inp3").value= (num1/num2).toFixed(4);
						}
					
		}
	</script>
</html>
